﻿using System;

namespace SimpleLibraryClasses
{
    [Serializable()]
    public class Book : Item
    {       
        public Book() : base() 
        {
        }
        
        /// <summary>
        /// The title of the book
        /// </summary>
        public String Title { get; set; }

        /// <summary>
        /// The book's author or list of authors
        /// </summary>
        public String Author { get; set; }

        /// <summary>
        /// The book's ISBN number
        /// </summary>
        public String ISBN { get; set; }

        /// <summary>
        /// The name of the book's publisher
        /// </summary>
        public String Publisher { get; set; }

        /// <summary>
        /// The date of publication
        /// </summary>
        public DateTime PublishDate { get; set; }


        public override bool IsValid()
        {
            if (String.IsNullOrEmpty(this.Title))
            {
                return false;
            }
            else
            {
                return true;
            }
        }

        /// <summary>
        /// The name of the book.
        /// </summary>
        public override string DisplayName
        {
            get { return this.Title; }
        }
    }
}
